﻿namespace Dexter.Scheduler {
	/// <summary>
	/// The base contract for registration of a job.
	/// </summary>
	/// <remarks>
	///	Do not use this interface for the concrete implementation but use <see cref="ICronJob"/> or <see cref="IFrequentlyJob"/>.
	/// </remarks>
	public interface IJob {

		/// <summary>
		/// Gets a value indicating whether [auto manage session].
		/// </summary>
		/// <value><c>true</c> if [auto manage session]; otherwise, <c>false</c>.</value>
		bool AutoManageSession { get; }

		/// <summary>
		/// Gets the name of the group.
		/// </summary>
		/// <value>The name of the group.</value>
		string GroupName { get; }

		/// <summary>
		/// Set to <c>false</c> if the state of Job will be reused from the next startup. Otherwise <c>false</c>.
		/// </summary>
		/// <value>
		/// 	<c>true</c> if this instance is volatile; otherwise, <c>false</c>.
		/// </value>
		bool IsVolatile { get; }

		/// <summary>
		///This method will be exececuted by the <see cref="IScheduler"/>
		/// </summary>
		/// <remarks>
		///	The execution interval depends by <see cref="ICronJob"/> or <see cref="IFrequentlyJob"/>.
		/// </remarks>
		void Execute ( );

		/// <summary>
		/// Gets the unique id.
		/// </summary>
		/// <value>The unique id.</value>
		string UniqueId { get; }
	}
}